home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-22 | 5.4 KB | 214 lines | [TEXT/MPS ] |
- //
- // File: MoonbaseSenderModels.c
- // Project: Moonbase Engine
- // Copyright: (c) 1996 Moonbase Enterprises Pty Ltd (ACN 072 298 554)
- //
-
- #include <key.h>
-
- extern const keyID K_X;
- extern const keyID K_Y;
- extern const keyID K_TIME;
- extern const keyID K_MAXIMUMTIME;
- extern const keyID K_USEMAXIMUMTIME;
-
- extern const keyID K_READATOM;
- extern const keyID K_WEIGHATOM;
- extern const keyID K_WRITEATOM;
-
- //
- // 5390 Scroll by
- //
-
- #define kScrollBySenderAtomType 'scby'
- typedef struct {
- long atomSize;
- unsigned long atomType;
- short x;
- short y;
- } ScrollBySenderAtom;
-
- void oScrollBySenderModelRead(key* the)
- {
- ScrollBySenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollBySenderAtom);
- anAtom.atomType = kScrollBySenderAtomType;
- keyCall1(the[ARGUMENT(1)], K_READATOM, keyFromPointer(&anAtom));
- keyPut(the[SELF], K_X, keyFromInteger(anAtom.x));
- keyPut(the[SELF], K_Y, keyFromInteger(anAtom.y));
- }
-
- void oScrollBySenderModelWeigh(key* the)
- {
- keyCall1(the[ARGUMENT(1)], K_WEIGHATOM, keyFromInteger(sizeof(ScrollBySenderAtom)));
- }
-
- void oScrollBySenderModelWrite(key* the)
- {
- ScrollBySenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollBySenderAtom);
- anAtom.atomType = kScrollBySenderAtomType;
- anAtom.x = keyToInteger(keyGet(the[SELF], K_X));
- anAtom.y = keyToInteger(keyGet(the[SELF], K_Y));
- keyCall1(the[ARGUMENT(1)], K_WRITEATOM, keyFromPointer(&anAtom));
- }
-
- //
- // 5391 Scroll to
- //
-
- #define kScrollToSenderAtomType 'scto'
- typedef struct {
- long atomSize;
- unsigned long atomType;
- short x;
- short y;
- } ScrollToSenderAtom;
-
- void oScrollToSenderModelRead(key* the)
- {
- ScrollToSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollToSenderAtom);
- anAtom.atomType = kScrollToSenderAtomType;
- keyCall1(the[ARGUMENT(1)], K_READATOM, keyFromPointer(&anAtom));
- keyPut(the[SELF], K_X, keyFromInteger(anAtom.x));
- keyPut(the[SELF], K_Y, keyFromInteger(anAtom.y));
- }
-
- void oScrollToSenderModelWeigh(key* the)
- {
- keyCall1(the[ARGUMENT(1)], K_WEIGHATOM, keyFromInteger(sizeof(ScrollToSenderAtom)));
- }
-
- void oScrollToSenderModelWrite(key* the)
- {
- ScrollToSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollToSenderAtom);
- anAtom.atomType = kScrollToSenderAtomType;
- anAtom.x = keyToInteger(keyGet(the[SELF], K_X));
- anAtom.y = keyToInteger(keyGet(the[SELF], K_Y));
- keyCall1(the[ARGUMENT(1)], K_WRITEATOM, keyFromPointer(&anAtom));
- }
-
- //
- // 5392 Scroll to Cell
- //
-
- #define kScrollToCellSenderAtomType 'sctc'
- typedef struct {
- long atomSize;
- unsigned long atomType;
- short x;
- short y;
- } ScrollToCellSenderAtom;
-
- void oScrollToCellSenderModelRead(key* the)
- {
- ScrollToCellSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollToCellSenderAtom);
- anAtom.atomType = kScrollToCellSenderAtomType;
- keyCall1(the[ARGUMENT(1)], K_READATOM, keyFromPointer(&anAtom));
- keyPut(the[SELF], K_X, keyFromInteger(anAtom.x));
- keyPut(the[SELF], K_Y, keyFromInteger(anAtom.y));
- }
-
- void oScrollToCellSenderModelWeigh(key* the)
- {
- keyCall1(the[ARGUMENT(1)], K_WEIGHATOM, keyFromInteger(sizeof(ScrollToCellSenderAtom)));
- }
-
- void oScrollToCellSenderModelWrite(key* the)
- {
- ScrollToCellSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(ScrollToCellSenderAtom);
- anAtom.atomType = kScrollToCellSenderAtomType;
- anAtom.x = keyToInteger(keyGet(the[SELF], K_X));
- anAtom.y = keyToInteger(keyGet(the[SELF], K_Y));
- keyCall1(the[ARGUMENT(1)], K_WRITEATOM, keyFromPointer(&anAtom));
- }
-
- //
- // 5393 Set Duration
- //
-
- #define kSetDurationSenderAtomType 'sedu'
- typedef struct {
- long atomSize;
- unsigned long atomType;
- long time;
- long maximumtime;
- unsigned char usemaximumtime;
- unsigned char filler;
- } SetDurationSenderAtom;
-
- void oSetDurationSenderModelRead(key* the)
- {
- SetDurationSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(SetDurationSenderAtom);
- anAtom.atomType = kSetDurationSenderAtomType;
- keyCall1(the[ARGUMENT(1)], K_READATOM, keyFromPointer(&anAtom));
- keyPut(the[SELF], K_TIME, keyFromInteger(anAtom.time));
- keyPut(the[SELF], K_MAXIMUMTIME, keyFromInteger(anAtom.maximumtime));
- keyPut(the[SELF], K_USEMAXIMUMTIME, keyFromBoolean(anAtom.usemaximumtime));
- }
-
- void oSetDurationSenderModelWeigh(key* the)
- {
- keyCall1(the[ARGUMENT(1)], K_WEIGHATOM, keyFromInteger(sizeof(SetDurationSenderAtom)));
- }
-
- void oSetDurationSenderModelWrite(key* the)
- {
- SetDurationSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(SetDurationSenderAtom);
- anAtom.atomType = kSetDurationSenderAtomType;
- anAtom.time = keyToInteger(keyGet(the[SELF], K_TIME));
- anAtom.maximumtime = keyToInteger(keyGet(the[SELF], K_MAXIMUMTIME));
- anAtom.usemaximumtime = keyToBoolean(keyGet(the[SELF], K_USEMAXIMUMTIME));
- keyCall1(the[ARGUMENT(1)], K_WRITEATOM, keyFromPointer(&anAtom));
- }
-
- //
- // 5394 Step by Time
- //
-
- #define kStepByTimeSenderAtomType 'stby'
- typedef struct {
- long atomSize;
- unsigned long atomType;
- long time;
- } StepByTimeSenderAtom;
-
- void oStepByTimeSenderModelRead(key* the)
- {
- StepByTimeSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(StepByTimeSenderAtom);
- anAtom.atomType = kStepByTimeSenderAtomType;
- keyCall1(the[ARGUMENT(1)], K_READATOM, keyFromPointer(&anAtom));
- keyPut(the[SELF], K_TIME, keyFromInteger(anAtom.time));
- }
-
- void oStepByTimeSenderModelWeigh(key* the)
- {
- keyCall1(the[ARGUMENT(1)], K_WEIGHATOM, keyFromInteger(sizeof(StepByTimeSenderAtom)));
- }
-
- void oStepByTimeSenderModelWrite(key* the)
- {
- StepByTimeSenderAtom anAtom;
-
- anAtom.atomSize = sizeof(StepByTimeSenderAtom);
- anAtom.atomType = kStepByTimeSenderAtomType;
- anAtom.time = keyToInteger(keyGet(the[SELF], K_TIME));
- keyCall1(the[ARGUMENT(1)], K_WRITEATOM, keyFromPointer(&anAtom));
- }
-